<%@ page language="java" import="java.util.*,com.fescoservice.model.*" pageEncoding="UTF-8"%>

<%
	String langfilename = "/resources/message";
	CategoryId id =(CategoryId) request.getAttribute("categoryId");
	List bbslist =(List) request.getAttribute("bbslist");
	BBS viewBBS =(BBS) request.getAttribute("viewBBS");
	BBSContent viewBBSContent =(BBSContent) request.getAttribute("viewBBSContent");
	List attachments =(List) request.getAttribute("viewBBSAttaches");
	Long viewBoardSeq = 0L;
	if(null!=viewBBS){ 
		viewBoardSeq = viewBBS.getId().getBoardSeq();
	}
%>
	
<%@include file="../common/LocaleManager.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Preview Content</title>
    <link rel="stylesheet" href="<%=path%>/js/jquery/themes/redmond/jquery.ui.all.css">
	<script src="<%=path%>/js/jquery/jquery-1.5.1.js"></script>
	<script src="<%=path%>/js/jquery/external/jquery.bgiframe-2.1.2.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.core.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.widget.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.mouse.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.button.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.draggable.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.position.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.ui.resizable.js"></script>
	<script src="<%=path%>/js/jquery/ui/jquery.effects.core.js"></script>

	<link rel="stylesheet" type="text/css" href="<%=path%>/css/admin.css">

	<script type="text/javascript">
		$(function() {
			$("#btnAdd").button().click(function() {
						document.forms.BBSId.action = '<%=path%>/action/Content.htm?cmd=addInit';
						document.forms.BBSId.submit();		
					});
			$("#btnList").button().click(function() {
						document.forms.BBSId.action = '<%=path%>/action/Category.htm?cmd=list';
						document.forms.BBSId.submit();		
					});
			$("#btnModify").button().click(function() {
						document.forms.BBSId.action = '<%=path%>/action/Content.htm?cmd=modifyInit';
						document.forms.BBSId.submit();		
					});
			$("#btnDel").button().click(function() {
						document.forms.BBSId.action = '<%=path%>/action/Content.htm?cmd=delete';
						document.forms.BBSId.submit();		
					});
			$("#btnDefault").button().click(function() {
						document.forms.BBSId.action = '<%=path%>/action/Content.htm?cmd=setDefault';
						document.forms.BBSId.submit();		
					});
		});
		function view(boardcode1,boardcode2,boardcode3,boardseq){
				document.forms.BBSId.action = '<%=path%>/action/Content.htm?cmd=view';												
				document.forms.BBSId.boardCode1.value=boardcode1; 
				document.forms.BBSId.boardCode2.value=boardcode2; 
				document.forms.BBSId.boardCode3.value=boardcode3;
				document.forms.BBSId.boardSeq.value=boardseq;
				document.forms.BBSId.submit();
			}
	</script>
  </head>
  
  <body>
  <div class="wrapContent">
  	<form name="BBSId" method="post">
		<input type="hidden" name="boardCode1" value="<%=id.getBoardCode1() %>" />
		<input type="hidden" name="boardCode2" value="<%=id.getBoardCode2() %>" />
		<input type="hidden" name="boardCode3" value="<%=id.getBoardCode3() %>" />
		<input type="hidden" name="boardSeq" value="<%=viewBoardSeq %>" />
	</form>
	
	<div class="contentView ui-widget">
	<%if(null!=viewBBS){ %>		
		<div class="title">
			<div class="left"><%=resource.getString("FS_T_TITLE")%> : </div>
			<div class="right"><%=viewBBS.getTitle() %></div>
		</div>
		<div class="content">
			<div class="left"><%=resource.getString("FS_T_CONTENT")%> : </div>
			<div class="right"><%=viewBBSContent.getContent() %></div>
		</div>
		<div class="attachments">
			<div class="left"><%=resource.getString("FS_T_ATTACH")%> : </div>
			<div class="right"></div>
		</div>
		<div class="buttonGroupRight">
			<div id="btnModify" ><%=resource.getString("FS_T_MODIFY")%></div>
			<div id="btnDel" ><%=resource.getString("FS_T_DELETE")%></div>
			<div id="btnDefault" ><%=resource.getString("FS_T_SETDEFAULT")%></div>
		</div>
		<div class="clear">	</div>
	<%	
	}else{ %>
		<div>
				<%=resource.getString("FS_M_NORESULT")%>
		</div>
	<%} %>
	</div>
	<div  class="ui-widget">
		<h3>
			 其他相关内容
		</h3>
		<table class="ui-widget ui-widget-content">
			<thead>
				<tr class="ui-widget-header ">
					<th>
						序号
					</th>
					<th>
						题目
					</th>
					<th>
						创建日期
					</th>
					<th>
						修改日期
					</th>
					<th>
						是否显示 
					</th>
					<th>
						查看
					</th>
					
				</tr>
			</thead>
			<tbody>
			<% if(bbslist.size()>1) { 
					BBS bbs = null;
					for(int i=1;i<bbslist.size();i++){
					bbs = (BBS)bbslist.get(i);
			%>
			
				<tr>
					<td>
						<%=i %>
					</td>
					<td>
						<%=bbs.getTitle() %>
					</td>
					<td>
						<%=bbs.getRegDate()%>
					</td>
					<td>
						<%=bbs.getUpdateDate()%>
					</td>
					<td>
						<%=bbs.getDefaultYn()%>
					</td>
					<td>
						<a href="javascript:view('<%=bbs.getId().getBoardCode1() %>','<%=bbs.getId().getBoardCode2() %>','<%=bbs.getId().getBoardCode3() %>','<%=bbs.getId().getBoardSeq() %>')" ><%=resource.getString("FS_T_VIEW")%></a>
					</td>
					
				</tr>
			<%	}
			}else{ %>
				<tr>
					<td colspan="6">
						<%=resource.getString("FS_M_NORESULT")%>
					</td>
				</tr>
			<%} %>
			</tbody>
		</table>
	</div>
	<div class="buttonGroupRight">
   		<div id="btnAdd" ><%=resource.getString("FS_T_ADD")%><%=resource.getString("FS_T_CONTENT")%></div>
		<div id="btnList" ><%=resource.getString("FS_T_LIST")%></div>
	</div>	
  </div>					
  </body>
</html>
